package com.imooc.framework.lambda;


import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

public class FunctionInterface {
    public static void main(String[] args) {
//        start(()->{
//            System.out.println("start thread");
//        });

//        Runnable runnable = start();
//        new Thread(runnable).start();

        Callable<String> callable= start();
        FutureTask<String> task = new FutureTask<>(callable);
        new Thread(task).start();
    }


//    public static void start(Runnable runnable){
//        new Thread(runnable).start();
//    }

//    public static Runnable start(){
//
//        return ()->{
//            System.out.println("测试");
//        };
//    }

    public static Callable<String> start(){

        return ()->{
            System.out.println("测试");
            return "name";
        };
    }
}
